package com.bleeth.fx.demo2;

import com.bleeth.fx.helper.ControlsHelper;
import com.bleeth.fx.layout.FormBuilder;
import com.bleeth.fx.layout.GirdCell;
import com.bleeth.fx.meta.IForm;
import com.bleeth.fx.meta.View;
import javafx.beans.property.Property;
import javafx.geometry.Pos;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;

/**
 * @author Sakura
 * @version 1.0
 * @date 2021-11-13 22:17
 **/
@View(value = "google", type = "begin")
public class GoogleView implements IForm {

    @Override
    public Region make(Property... properties) {
        VBox googleForm = FormBuilder.form(1000D, 600D)
                .addEmptyRow(30D)
                .addRow(GirdCell.createCell(1, Pos.CENTER), GirdCell.createCell(1, Pos.CENTER_RIGHT, 10), GirdCell.createCell(20D, Pos.CENTER_RIGHT, 10))
                .addCell(1, ControlsHelper.createLabel("Google", "lbl_hover", "h4"))
                .addCell(1, ControlsHelper.createLabel("图片", "lbl_hover", "h4"))
                .addCell(1, ControlsHelper.createWrapperImg("img/demo2/func.png", 30, 30))
                .addCell(1, ControlsHelper.createWrapperImg("img/demo2/email.png", 30, 30))
                .endRow(false)
                .addEmptyRow(30D)
                .addRow(GirdCell.createCell(1, Pos.CENTER))
                .addCell(0, ControlsHelper.createWrapperImg("img/demo2/google.png", 110, 340))
                .endRow(false)
                .addEmptyRow(60D)
                .addRow(GirdCell.createCell(1, Pos.CENTER))
                .addCell(0, searchForm())
                .endRow(false)
                .addEmptyRow(60D)
                .addRow(GirdCell.createCell(1, Pos.CENTER, 20))
                .addCell(0, ControlsHelper.createBtn("Google 搜索", "", ""))
                .addCell(0, ControlsHelper.createBtn("手气不错", "", ""))
                .endRow(false)
                .addEmptyRow(60D)
                .addRow(GirdCell.createCell(1, Pos.CENTER, 20))
                .addCell(0, ControlsHelper.createLabel("Google 提供：", "lbl_hover", ""))
                .addCell(0, ControlsHelper.createBtn("English", "", ""))
                .addCell(0, ControlsHelper.createBtn("繁體中文", "", ""))
                .endRow(false)
                .addEmptyRow(200D)
                .scaleRow(0.5D,GirdCell.createCell(20D, Pos.CENTER),GirdCell.createCell(1, Pos.CENTER_LEFT))
                .addCell(1, ControlsHelper.createLabel("香港", "lbl_hover", ""))
                .endRow(false)
                .scaleRow(1,GirdCell.createCell(20D, Pos.CENTER),GirdCell.createCell(1, Pos.CENTER_LEFT,20),GirdCell.createCell(1, Pos.CENTER_RIGHT,20),
                        GirdCell.createCell(20D, Pos.CENTER_LEFT))
                .addCell(1, ControlsHelper.createLabel("Google 大全", "lbl_hover", ""))
                .addCell(1, ControlsHelper.createLabel("广告", "lbl_hover", ""))
                .addCell(1, ControlsHelper.createLabel("商务", "lbl_hover", ""))
                .addCell(1, ControlsHelper.createLabel("Google 搜索的运作方式", "lbl_hover", ""))
                .addCell(2, ControlsHelper.createLabel("隐私权", "lbl_hover", ""))
                .addCell(2, ControlsHelper.createLabel("条款", "lbl_hover", ""))
                .addCell(2, ControlsHelper.createLabel("设置", "lbl_hover", ""))
                .endRow(false)
                .build();
        return googleForm;
    }


    public Region searchForm() {
        return FormBuilder.form(600D, 50D)
                .coverRow(GirdCell.createCell(40D, Pos.CENTER), GirdCell.createCell(1, Pos.CENTER), GirdCell.createCell(40D, Pos.CENTER))
                .addCell(0, ControlsHelper.createWrapperImg("img/demo2/search.png", 16, 16,true))
                .coverCell(1, ControlsHelper.createTextField("", "", "", ""))
                .addCell(2, ControlsHelper.createWrapperImg("img/demo2/record.png", 16, 16,true))
                .endRow(false)
                .build();
    }


    @Override
    public void css() {
        //css加载
    }


}
